/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity.xml;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

/**
 *
 * @author Quirino
 */
public class EUtente {
    
    private int ID;
    private String username;
    private String password;
    private String avatar;
    private String nickname;
    private String nome;
    private String cognome;
    private Date datanascita;
    private String indirizzo;
    private String citta;
    private ArrayList<EUtente> rubrica;

    public ArrayList<EUtente> getRubrica() {
        return rubrica;
    }

    public void setRubrica(ArrayList<EUtente> rubrica) {
        this.rubrica = rubrica;
    }

    public int getID() {
        return ID;
    }

    public void setID(int ID) {
        this.ID = ID;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getCitta() {
        return citta;
    }

    public void setCitta(String citta) {
        this.citta = citta;
    }

    public String getCognome() {
        return cognome;
    }

    public void setCognome(String cognome) {
        this.cognome = cognome;
    }

    public Date getDatanascita() {
        return datanascita;
    }

    public void setDatanascita(Date datanascita) {
        this.datanascita = datanascita;
    }

    public String getIndirizzo() {
        return indirizzo;
    }

    public void setIndirizzo(String indirizzo) {
        this.indirizzo = indirizzo;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }
    
    public EUtente(){
        this.rubrica = new ArrayList<EUtente>();
    }
    
    public void printUser(){
        
        System.out.println("\n");
        System.out.println("==============================");
        System.out.println("ID User: " + this.getID() + " ; \n");
        System.out.println("Username User: " + this.getUsername() + " ; \n");
        System.out.println("Password User: " + this.getPassword() + " ; \n");
        System.out.println("Nome User: " + this.getNome() + " ; \n");
        System.out.println("Cognome User: " + this.getCognome() + " ; \n");
        System.out.println("Avatar User: " + this.getAvatar() + " ; \n");
        System.out.println("Indirizzo User: " + this.getIndirizzo() + " ; \n");
        System.out.println("Citta User: " + this.getCitta() + " ; \n");
        SimpleDateFormat formatDate = new SimpleDateFormat("yyyy-MM-dd");
        String dateFormatted = formatDate.format(this.getDatanascita().getTime());
        System.out.println("DataNascita(yyyy-mm-dd) User: " + dateFormatted + " ; \n");
        this.printRubrica();
        System.out.println("==============================");
    }
    
    public void printRubrica(){
        System.out.println("Rubrica User: \n");
        for(int i=0; i<this.rubrica.size(); i++){
            
            System.out.println( (i+1) + ":" + this.rubrica.get(i).getNickname() );
            
        }
        System.out.println("End Rubrica User: \n");
    }
    
}
